package com.nbsaas.boot.site.rest.convert;

import com.nbsaas.boot.site.data.entity.DynamicPage;
import com.nbsaas.boot.site.api.domain.simple.DynamicPageSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* -列表对象转换器
*/

public class DynamicPageSimpleConvert implements Converter<DynamicPageSimple, DynamicPage> {




@Override
public DynamicPageSimple convert(DynamicPage source) {
    DynamicPageSimple result = new DynamicPageSimple();

                result.setNote(source.getNote());

               try {
                   if(source.getDynamicPageCatalog()!=null){
                       result.setDynamicPageCatalog(source.getDynamicPageCatalog().getId());
                   }
                } catch (Exception ignored) { }

                result.setIntroduce(source.getIntroduce());
                result.setName(source.getName());
                result.setLogo(source.getLogo());
                result.setId(source.getId());

                try {
                    if(source.getDynamicPageCatalog()!=null){
                        result.setDynamicPageCatalogName(source.getDynamicPageCatalog().getName());
                    }
                } catch (Exception ignored) { }

                result.setAddDate(source.getAddDate());
                result.setKey(source.getKey());
                result.setLastDate(source.getLastDate());


    return result;
}

}